<?php
	require('../_inc/config.php');

	//header('HTTP/1.1 403 Forbidden');
	//header('Last-Modified: '. gmdate('D, d M Y H:i:s' ) . ' GMT');

	header('Content-Type: text/html; charset=' . $html['charset']);
	header('Content-Type: text/plain');
	header('Cache-Control: max-age=36000 ');


	$handle	=	@mysql_connect($db['host'], $db['user'], $db['passwd']);
	if( mysql_errno()!=0 ){
		die('{0:"!Error01"}');
	}
	if( !@mysql_select_db($db['dbname'], $handle) ){
		die('{0:"!Error02"}');
	}

	$id	= (int) $_GET['id'];
	if( !$id ){
		die('{0:"!Error03"}');
	}

	$rs	= mysql_query('SELECT id,paramName,paramValue FROM _super_param WHERE pid=' . $id . ' ORDER BY orderId DESC, id ASC limit 100');

	if( !$rs ){
		die('{0:"!Error04"}');
	}

	$L	= array();
	while ( $row = mysql_fetch_array($rs, MYSQL_NUM) ) {
		if( $row[2] != '' ){
			$key	= (int) $row[2];
		}else{
			$key	= $row[0];
		}
		$val		= str_replace('"', '\\"', $row[1] );
		array_push($L, $key . ':"' . $val . '"');
	}

	/*
		if( $_SERVER['REMOTE_ADDR'] == '192.168.0.9' ){
			array_unshift($L, '0:"' . date("H:i:s") . '"');
		}
	*/

	echo '{' . join(',', $L) . '}';
?>